<template>
<div id="asideapp" class="higsty">
    <el-row class="tac widstyle">
  <el-col :span="12" class="aswsty">
    <el-menu
      default-active="2"
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose"
      >     
      <div class="el-submenu__title menusty">菜单管理</div>
      <el-submenu index="1" v-show="isflag">
        <template slot="title">
          <i class="el-icon-menu"></i>
          <span>课程管理</span>
        </template>
        <el-menu-item-group >                  
          <el-menu-item index="1-1"  @click="switchTo('/coursemanage')">课程上传</el-menu-item>
        </el-menu-item-group>       
         <el-menu-item-group>                  
          <el-menu-item index="1-2"  @click="switchTo('/interaction')">课堂互动管理</el-menu-item>
        </el-menu-item-group> 
      </el-submenu>
      <el-submenu index="5" v-show="isflag">
        <template slot="title">
          <i class="el-icon-menu"></i>
          <span>综合考试</span>
        </template>
        <el-menu-item-group>
          <el-menu-item index="5-1" @click="switchTo('/examconfig')">综合考试配置</el-menu-item>
        </el-menu-item-group>
        <el-menu-item-group>
          <el-menu-item  index="5-2" @click="switchTo('/examimport')">综合考试题库</el-menu-item>
        </el-menu-item-group>
      </el-submenu>
      <el-submenu index="2" >       
        <template slot="title">
          <i class="el-icon-menu"></i>
          <span>数据分析</span>
        </template>
        <el-menu-item-group>                  
          <el-menu-item index="2-1"  @click="switchTo('/coursematerials')">导师课堂材料</el-menu-item>
        </el-menu-item-group>
        <el-menu-item-group>                  
          <el-menu-item index="2-2"  @click="switchTo('/stsumdata')">学生数据统计</el-menu-item>
        </el-menu-item-group> 
         <el-menu-item-group>                  
          <el-menu-item index="2-3" @click="switchTofr">学生数据汇总报表</el-menu-item>
        </el-menu-item-group>            
      </el-submenu>
      <el-submenu  index="3" v-show="isflag">
        <template slot="title">
        <i class="el-icon-menu"></i>
        <span>账号管理</span>
        </template>
         <el-menu-item-group>                  
          <el-menu-item index="3-1"  @click="switchTo('/teachermanage')">导师账号管理</el-menu-item>
        </el-menu-item-group>
        <el-menu-item-group>                  
          <el-menu-item index="3-2"  @click="switchTo('/adminmanage')">管理员账号管理</el-menu-item>
        </el-menu-item-group>
      </el-submenu >  
      <el-menu-item index="6" v-show="isflag" @click="switchTo('/studentinfolist')">
        <i class="el-icon-setting"></i>
        <span slot="title">员工注册数据修复</span>
      </el-menu-item>  
      <el-menu-item index="4" @click="switchTo('/editpasssword')">
        <i class="el-icon-setting"></i>
        <span slot="title">密码修改</span>
      </el-menu-item>
    </el-menu>
  </el-col>
</el-row>
</div>

</template>
<script>
export default {
  data() {
    return {
      isflag: false,  
    };
  },
  methods: {  
    handleOpen(key, keyPath) {
      //console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      //console.log(key, keyPath);
    },
    switchTo(path) {
      this.$router.replace(path);
    },
    //帆软
    switchTofr(){
       var name= JSON.parse(this.$store.state.teacherinfo);
       if(name.Te_number=="admin"){
         window.open("http://jhwx.bestlink.com.cn/WebReport/ReportServer?reportlet=edu%2FMainTrain.cpt");
       }else{
         window.open("http://jhwx.bestlink.com.cn/WebReport/ReportServer?reportlet=edu%2FMainTrain.cpt&Dep_Name="+name.Te_depart); 
       }      
    },
    getinfo() {
      if (this.$store.state.teacherinfo == null) {
        this.$message({
          type: "info",
          message: "登录失效，请重新登录!"
        });
        this.$router.push("/login");
      }
    }
  },
  mounted() {
    this.getinfo();
    var teacher = JSON.parse(this.$store.state.teacherinfo);
    if (teacher.Te_isadmin == 1) {
      this.isflag = true;
    }
  }
};
</script>
<style scoped>
@import url("//unpkg.com/element-ui@2.12.0/lib/theme-chalk/index.css");
.higsty {
  height: 100%;
}
.aswsty {
  width: 100%;
}
.menusty {
  letter-spacing: 2px;
  font-size: 23px;
  background: rgb(140, 197, 255);
  color: white;
  text-align: center;
}
.asty{
  color: #303133;
  text-decoration: none;
}
</style>

